As a technical analyst in the GIS department, you want create to be able to access 311 service request data through a website or portal. You want users to be able to request the data by neighbourhood and have the results returned as a downloadable file using the Data Download service. This can be done through the use of Webhook URLs.
In this exercise, you’ll create a Webhook URL that runs a workspace. You’ll also learn how to modify values in the Webhook URL to edit workspace parameters.
Open starting workspace template (exercise-submit-job-through-webhook-url.fmwt) in FME Workbench (2024.1 or later)
Run the workspace then right-click on the 311Requests feature type to bring up the popup menu. Then click View Written Data... to open the dataset in Visual Preview.
You’ll see all the open service requests. We should note what the data looks like so we will know where it has changed once we’ve updated the feature type in the webhook URL.
Save the workspace as exercise-submit-job-through-webhook-url.fmwt and publish it to the Training repository in FME Flow. Make sure to check the Upload data files option. Register it with the Job Submitter and Data Download service.
Click the Direct Link to the workspace in the Translation Log http://localhost/fmeserver/workspaces/run/Flow%20Authoring/exercise-submit-job-through-webhook-url.fmw and log in if necessary.
Select Training as the Repository and set the Service to Data Download. Leave the default values for Feature Types to Read
Click on Workspace Actions and select Create Webhook.
Modify the default URL. Expand the Parameters panel. Try removing one of the values (e.g. “Downtown”) to see how it changes Webhook URL Preview in real-time.
Select Reset to restore Parameter default values and click OK.
Before doing anything else, select the Download Webhook button to save the webhook information to your desktop. This file contains information about the new Webhook URL. It is the only opportunity we get to save its newly created token.
Open another browser window in incognito mode in order to test our new token. Paste the Authorization with Query String Webhook URL into the search bar and submit. You will receive a link to download a zip file containing the results as a GeoJSON file.
Download and extract the zip file and open the 311-service-requests.geojson in FME Data Inspector to view the results
Next to the query string’s FEATURE_TYPES parameter, delete all the values except “Downtown” (including the URL encoding). The result will look like this URL:
Submit to receive a new download link. Inspect the new GeoJSON file in FME Data Inspector again. This time, the output GeoJSON is clipped only to the “Downtown” selection.
In FME Flow, navigate to the Jobs > Completed page. Find the last submitted job by the workspace name and time of submission.
Select the job to review the log. Expand REQUEST DATA to find the parameters.
Congratulations! You’ve now run a job, using multiple parameters, via Webhook URL.